<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="/template/main_template.xhtml" 
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:pe="http://primefaces.org/ui/extensions"
	xmlns:sec="http://www.springframework.org/security/tags">
	
<ui:define name="title">
Project Setup
</ui:define>

<ui:define name="content">	

<p:panel id="panel" header="Project Details" style="width:95%">  
    
<p:focus context="panel"/> 
      
<h:form id="projectForm">  
	<h:panelGrid columns="4" style="width:100%">
		<p:outputLabel value="Project Name" for="projectName"/>
		<p:inputText id="projectName" value="#{projectSetup.project.projectName}" maxlength="40" required="true" autocomplete="off"/>
		<p:outputLabel value="Project Code" for="code"/>
		<p:inputText id="code" value="#{projectSetup.project.projectCode}" maxlength="10" required="true" autocomplete="off"/>
		
		
		<p:outputLabel value="Developer Name" for="developerName"/>
		<p:selectOneMenu id="developerName" value="#{projectSetup.project.developerId}"> 
			<f:selectItems value="#{projectSetup.developers}" />
		</p:selectOneMenu>
		<p:outputLabel value="Land Proprietor" for="developerName"/>
		<p:selectOneMenu id="landProprietor" value="#{projectSetup.project.landProprietorId}"> 
			<f:selectItems value="#{projectSetup.landProprietors}" />
		</p:selectOneMenu>

		<p:outputLabel value="Property Type" for="propType"/>
		<p:selectOneMenu id="propType" value="#{projectSetup.project.propertyType}" >
			<f:selectItems value="#{projectSetup.propertyTypes}"/>
		</p:selectOneMenu>
		<p:outputLabel value="Person In Charge" for="pic"/>
		<p:inputText id="pic" value="#{projectSetup.project.personInCharge}" maxlength="30" autocomplete="off"/>

		<p:outputLabel value="PIC Mobile" for="picMobile"/>
		<h:panelGroup>
			<p:inputText id="picMobile" value="#{projectSetup.project.picMobileNo}" maxlength="20" autocomplete="off"/>
			<p:outputLabel value="  ie. 0129876543" />
		</h:panelGroup>
		<p:outputLabel value="Launch Date" for="launchDate"/>
		<p:calendar id="launchDate" value="#{projectSetup.project.launchDate}"  pattern="dd/MM/yyyy"/>
		
		<p:outputLabel value="Report Group" for="rptGroup"/>
		<p:selectOneMenu id="rptGroup" value="#{projectSetup.project.reportGroup}" >
			<f:selectItems value="#{projectSetup.reportGroups}"/>
		</p:selectOneMenu>
		<p:outputLabel value="Status" for="status"/>
		<p:selectOneMenu id="status" value="#{projectSetup.project.status}" >
			<f:selectItems value="#{projectSetup.statusList}"/>
		</p:selectOneMenu>

		<p:outputLabel value="Discount Rate"/>
		<pe:inputNumber value="#{projectSetup.project.discountRate}" minValue="0" maxValue="100" emptyValue="0" decimalPlaces="2"/> 
		<p:outputLabel value="Sales Commission"/>
		<pe:inputNumber value="#{projectSetup.project.salesCommission}" maxValue="999999999.99" emptyValue="0" decimalPlaces="2"/>

		<p:outputLabel value="Late Payment Interest (% per year)"/>
		<pe:inputNumber value="#{projectSetup.project.latePymtIntRate}" minValue="0" maxValue="100" emptyValue="0" decimalPlaces="2"/> 
		<p:outputLabel value="Late Payment Fee"/>
		<pe:inputNumber value="#{projectSetup.project.latePymtFee}" maxValue="999999999.99" emptyValue="0" decimalPlaces="2"/>

		<p:outputLabel value="Address Line 1" for="address1"/>
		<p:inputText id="address1" value="#{projectSetup.project.address1}" maxlength="20" required="true" />
		<p:outputLabel value="Address Line 2" for="address2"/>
		<p:inputText id="address2" value="#{projectSetup.project.address2}" maxlength="20" />
		
		
		<p:outputLabel value="Address Line 3" for="address3"/>
		<p:inputText id="address3" value="#{projectSetup.project.address3}" maxlength="20" />
		<p:outputLabel value="Address Line 4" for="address4"/>
		<p:inputText id="address4" value="#{projectSetup.project.address4}" maxlength="20" />
		
		<p:outputLabel value="Post Code" for="postcode"/>
		<h:panelGroup>
			<p:inputText id="postcode" value="#{projectSetup.project.postcode}" maxlength="10" autocomplete="off"/>
		</h:panelGroup>
		<p:outputLabel value="City" for="city"/>
		<p:inputText id="city" value="#{projectSetup.project.city}" maxlength="20" />

		<p:outputLabel value="State" for="state"/>
		<p:selectOneMenu id="state" value="#{projectSetup.project.state}">
			<f:selectItems value="#{projectSetup.states}"/>
		</p:selectOneMenu>
		<p:outputLabel value="Country" for="state"/>
		<p:selectOneMenu id="country" value="#{projectSetup.project.country}">
			<f:selectItems value="#{projectSetup.countries}"/>
		</p:selectOneMenu>
		
		<p:outputLabel value="Project Office Tel" for="tel"/>
		<p:inputText id="tel" value="#{projectSetup.project.projectOfficeTelNo}" maxlength="15" autocomplete="off"/>
		<p:outputLabel value="Project Office Fax" for="fax"/>
		<p:inputText id="fax" value="#{projectSetup.project.projectOfficeFaxNo}" maxlength="15" autocomplete="off"/>

		<p:outputLabel value="Location Longtitude" for="locationLongtitude"/>
		<p:inputText id="locationLongtitude" value="#{projectSetup.project.locationLongtitude}" autocomplete="off"/>
		<p:outputLabel value="Location Latitude" for="locationLatitude"/>
		<p:inputText id="locationLatitude" value="#{projectSetup.project.locationLatitude}" autocomplete="off"/>
		
		<p:outputLabel value="Total Units"/>
		<p:inputText value="#{projectSetup.totalUnits}" maxlength="10" disabled="true"/>
	</h:panelGrid>
	
	<br/>
		<p:commandButton value="Back" action="#{projectSetup.listProject}" ajax="false" immediate="true" icon="ui-icon-arrowreturn-1-w"/>  &nbsp;&nbsp;
		<p:commandButton value="Save" action="#{projectSetup.saveProject}" ajax="false"  icon="ui-icon-disk"/>
</h:form> 

</p:panel>

</ui:define>

</ui:composition>